package com.csce.domain.entity.score;

import cn.hutool.json.JSONUtil;
import com.osce.common.annotation.Excel;
import com.osce.common.core.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.util.List;

/**
 * 考试模版表对象 score_ex_model
 *
 * @author zzx
 * @since 2023-08-22
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
@ToString
@EqualsAndHashCode(callSuper = true)
public class ScoreExModel extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    private Long id;

    /**
     * 名称
     */
    @Excel(name = "名称")
    @ApiModelProperty("名称")
    private String name;

    /**
     * 最大学生数
     */
    @Excel(name = "最大学生数")
    @ApiModelProperty("最大学生数")
    private Integer maxStudent;

    /**
     * 现场考官权重
     */
    @Excel(name = "现场考官权重")
    @ApiModelProperty("现场考官权重")
    private Integer sceneExaminerWi;

    /**
     * 中控考官权重
     */
    @Excel(name = "中控考官权重")
    @ApiModelProperty("中控考官权重")
    private Integer centerExaminerWi;

    /**
     * 远程考官权重
     */
    @Excel(name = "远程考官权重")
    @ApiModelProperty("远程考官权重")
    private Integer sshExaminerWi;

    /**
     * 考试间隔时间
     */
    @Excel(name = "考试间隔时间")
    @ApiModelProperty("考试间隔时间")
    private Integer examIntervalTime;

    /**
     * 排站规则
     */
    @Excel(name = "排站规则")
    @ApiModelProperty("排站规则")
    private String allotPlaceRule;

    /**
     * 必过技能
     */
    @Excel(name = "必过技能")
    @ApiModelProperty("必过技能")
    private String mustSkill;
    private List<String> mustSkillList;

    /**
     * 预留字段1
     */
    @Excel(name = "预留字段1")
    @ApiModelProperty("预留字段1")
    private String reservedOne;

    /**
     * 预留字段2
     */
    @Excel(name = "预留字段2")
    @ApiModelProperty("预留字段2")
    private String reservedTwo;

    /**
     * 考试模版时间分段表信息
     */
    private List<ScoreExModelTime> scoreExModelTimeList;

    /**
     * 考试模版时间考场表信息
     */
    private List<ScoreExModelPlace> scoreExModelPlaceList;
    private Integer scoreExModelPlaceCount;


    public String getMustSkill() {
        return mustSkill;
    }

    public void setMustSkill(Object mustSkill) {
        this.mustSkill = JSONUtil.toJsonStr(mustSkill);
        if (mustSkill instanceof CharSequence) {//数据库
            this.mustSkillList = JSONUtil.toList(this.mustSkill, String.class);
        }
    }
}
